home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
G-Games
/
(c)g5.d64
/
black jack 3
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
152 lines
90 I=RND(-TI*1E9):J=0:K=0:L=0:M=0:N=0:CD%=0:C%=0:CV%=0:S%=0:V%=0:T1=0
100 S1$=" [216] [218] [211] [193] ":S2$=" [216] [216] [218][160][160][160][218][160][211][160][160][160][211][160][193][160][160][160][193][160]":R$=CHR$(13)
110 C$="":B$="[147] "+R$
115 FORI=1TO7:B$=B$+" [166][166][166][166][166] "+R$:NEXT:B$=B$+" "
120 A$=LEFT$(C$,11)
130 DIMD%(51):FORI=0TO51:D%(I)=I:NEXT:DIMN$(13):FORI=1TO13:READN$(I):NEXT
140 DATAA,2,3,4,5,6,7,8,9,10,J,Q,K
160 DIMS$(2,3):FORI=0TO3:S$(0,I)=" ":S$(1,I)=MID$(S1$,I*4+1,7)
170 S$(2,I)=MID$(S2$,I*6+1,7):NEXTI
180 DIMS%(10,7):FORI=1TO10:FORJ=1TO7:READS%(I,J):NEXTJ,I
190 DATA0,0,0,1,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,1,2,0,0,0,0,0,2,2,0,0,1,0,0,2
200 DATA2,0,0,2,0,0,2,2,0,1,0,2,0,2,2,0,2,0,2,0,2,2,0,2,1,2,0,2,2,1,2,0,2,1,2
210 DIMF$(3,7):FORI=1TO3:FORJ=1TO7:READF$(I,J):NEXTJ,I:DIMP%(2,7),AC%(1)
220 DATA"[223][146] [169] "," [146][188][167][186] "," [161][146][169][169][146][223] "
230 DATA" [166][169][214][146][169][166] "," [223][146][169][169][146][161] "
240 DATA" [167][208] [146][187] "," [146][169] [223]","[169][208] "," [146][169][194][170] "," [146] [187] "," [166][214][214][214][166] "
250 DATA" [188][146] "," [180][221][169] "," [204][146][169]","[223][146] [169] "," [167] [166][194] "," [146][169] [188] "
260 DATA" [166][191][191][191][166] "," [146][187] [169] "," [221][166] [165] "," [146][169] [223]"
300 PRINT"[147]";TAB(15)"BLACKJACK"
310 PRINT"MINIMUM BET--$10 TABLE LIMIT--$250.":PRINT"BET ONLY EVEN DOLLAR AMOUNTS."
320 FORI=0TO2:FORJ=0TO7:P%(I,J)=0:NEXT:AC%(0)=0:AC%(1)=0:I%=0
330 PRINT"YOU HAVE ";:IFW%<0THENPRINT"LOST";:GOTO335
332 PRINT"WON";
335 PRINT" $";ABS(W%)
340 PRINT"YOUR BET IS $ ";:GOSUB60000:B%=VAL(IN$):IFB%<10ORB%>250THEN300
350 FORI=0TO2:FORJ=0TO7:P%(I,J)=0:NEXTJ,I:AC%(0)=0:AC%(1)=0
360 FORI=0TO1:FORJ=1TO2:GOSUB11000:P%(I,J)=CV%:P%(I,0)=P%(I,0)+C%
370 IFC%=1THENP%(I,0)=P%(I,0)+10:AC%(I)=AC%(I)+1
380 NEXTJ,I
400 GOSUB9000
410 S%=P%(0,2)/13:V%=P%(0,2)-13*S%+1:C%=V%+(V%-10)*(V%>10)
420 IFC%>1ANDC%<10THEN560
430 IFC%=10THEN460
440 :PRINTA$"DO YOU WANT $";B%/2;"INSURANCE (Y/N) ?";:GOSUB60000
450 IFLEFT$(IN$,1)="Y"THENI%=B%/2
451 IFLEFT$(IN$,1)="Y"THEN PRINT"[145][145] "
452 IFLEFT$(IN$,1)="Y"THEN PRINT" "
460 IFP%(0,0)<>21THEN530
470 GOSUB8900
480 IFP%(1,0)<>21THEN500
490 :PRINTA$"IT'S A STAND-OFF -- BOTH HAVE BLACKJACK":GOTO6000
500 IFI%>0THEN520
510 :PRINTA$"DEALER WINS WITH BLACKJACK. ":W%=W%-B%:GOTO6000
520 :PRINTA$"DEALER HAS BLACKJACK "
521 PRINT"BUT YOUR INSURANCE BET WINS, SO NO LOSS"
525 GOTO6000
530 IFI%=0THEN560
540 W%=W%-I%
550 :PRINTA$"DEALER DOES NOT HAVE BLACKJACK. "
551 PRINT"YOUR INSURANCE BET LOSES."
555 FORI=1TO2000:NEXT
560 IFP%(1,0)<>21THEN590
570 GOSUB8900
580 :PRINTA$"BLACKJACK!--PAYS 3 TO 2 OR $";B%*3/2:W%=W%+B%*3/2:GOTO6000
590 REM LOCATION FOR OPTION BETS
600 N=3:GOTO620
610 N=N+1
620 :PRINTA$"ANOTHER CARD (Y/N) ? [157][157][157]";:GOSUB60000:IFLEFT$(IN$,1)="N"THEN730
630 IFLEFT$(IN$,1)<>"Y"THEN620
640 GOSUB11000:P%(1,N)=CV%:P%(1,0)=P%(1,0)+C%
650 IFC%=1THENP%(1,0)=P%(1,0)+10:AC%(1)=AC%(1)+1
660 IFN=6THENN=1
670 T1=(N-1)*8:CV%=P%(1,N):PRINTC$;:GOSUB10000:GOSUB8800
680 IFP%(1,0)<=21THEN610
690 IFAC%(1)>0THEN720
700 GOSUB8900
710 :PRINTA$"YOU BUSTED AND LOSE YOUR $";B%;"BET.":W%=W%-B%:GOTO6000
720 AC%(1)=AC%(1)-1:P%(1,0)=P%(1,0)-10:GOTO680
730 GOSUB8900:IFP%(0,0)>=17THEN850
740 N=3:GOTO760
750 N=N+1
760 GOSUB11000:P%(0,N)=CV%:P%(0,0)=P%(0,0)+C%
770 IFC%=1THENP%(0,0)=P%(0,0)+10:AC%(0)=AC%(0)+1
780 IFN=6THENN=1
790 T1=(N-1)*8:CV%=P%(0,N):PRINT"";:GOSUB10000
800 IFP%(0,0)<17THEN750
810 IFP%(0,0)<=21THEN870
820 IFAC%(0)>0THEN840
830 :PRINTA$"DEALER BUSTED, SO YOU WIN $";B%:W%=W%+B%:GOTO6000
840 AC%(0)=AC%(0)-1:P%(0,0)=P%(0,0)-10:GOTO800
850 IFP%(0,0)<=21THEN870
860 AC%(0)=AC%(0)-1:P%(0,0)=P%(0,0)-10:GOTO740
870 IFP%(0,0)<=P%(1,0)THEN900
880 :PRINTA$"DEALER HAS";P%(0,0);"[157] ";"TO YOUR";P%(1,0);"[157] "
890 PRINT"HE WINS THE $";B%;"BET":W%=W%-B%:GOTO6000
900 IFP%(0,0)=P%(1,0)THEN930
910 PRINTA$"YOU HAVE [157]";P%(1,0);"[157] TO THE DEALER'S [157]";P%(0,0);"[157] "
920 PRINT"YOU WIN THE $";B%;"BET":W%=W%+B%:GOTO6000
930 :PRINTA$"STAND-OFF WITH";P%(0,0);"EACH":GOTO6000
6000 PRINT"NEXT HAND (Y/N) ? ";:GOSUB60000:IFLEFT$(IN$,1)="Y"THENPRINT"[147]";:GOTO320
6010 IFLEFT$(IN$,1)<>"N"THEN6000
6020 PRINT"YOU FINISHED ";:IFW%<0THENPRINT"DOWN";:GOTO6040
6030 PRINT"UP";
6040 PRINT" BY $";ABS(W%)
7000 PRINT"[154]"
8000 END
8800 PRINTC$RIGHT$(C$,9)"TOTAL= [157]";P%(1,0);"[157] POINTS";
8810 IFAC%(1)THENPRINT" OR TOTAL= [157]";P%(1,0)-10;"[157] POINTS[145]";:RETURN
8820 PRINT" [145]";:RETURN
8900 REM PRINT DEALER'S FIRST CARD
8910 PRINT"";:T1=0:CV%=P%(0,1):GOSUB10000:RETURN
9000 REM PRINT INITIAL CARDS
9010 PRINTB$;:T1=8:PRINT"";:CV%=P%(0,2):GOSUB10000:PRINTC$;:T1=0:FORI=1TO2
9020 CV%=P%(1,I):GOSUB10000:NEXT:GOSUB8800:RETURN
9999 STOP
10000 REM CARD PRINTING SBR
10010 S%=CV%/13:V%=CV%-13*S%+1
10040 PRINTTAB(T1)""LEFT$(N$(V%)+" ",7):FORJ=1TO7
10050 IFV%>10THEN10070
10060 PRINTTAB(T1);"";S$(S%(V%,J),S%):GOTO10110
10070 IFJ=1THENPRINTTAB(T1)" "MID$("[216][218][211][193]",S%+1,1)F$(V%-10,J):GOTO10110
10080 IFJ=7THENPRINTTAB(T1)""F$(V%-10,J)""MID$("[216][218][211][193]",S%+1,1)" ":GOTO10110
10090 PRINTTAB(T1);"";F$(V%-10,J)
10110 NEXTJ:PRINTTAB(T1)""RIGHT$(" "+N$(V%),7):T1=T1+8:PRINT"[145][145][145][145][145][145][145][145][145]";
10120 RETURN
11000 IFCD%=52THENCD%=0
11010 IFCD%<>0THEN11040
11020 REM SHUFFLE WITHIN DECK D%(51)
11030 FORK=0TO51:L=INT((52-I)*RND(1)):M=D%(L):D%(L)=D%(51-K):D%(51-K)=M:NEXTK
11040 CV%=D%(CD%):S%=D%(CD%)/13:V%=D%(CD%)-13*S%+1:C%=V%+(V%-10)*(V%>10)
11050 CD%=CD%+1:RETURN
60000 IN$=" ":ZT=TI:ZC=2:ZD$=CHR$(20)
60010 GETZ$:IF Z$<>""THEN60070
60020 IFZT<=TITHENPRINTMID$(" [166]",ZC,1);"[157]";:ZC=3-ZC:ZT=TI+15
60030 GOTO60010
60070 Z=ASC(Z$):ZL=LEN(IN$):IF(ZAND127)<32THENPRINT" [157]";:GOTO60110
60080 IFFLAND(ZAND127)>64AND(ZAND127)<91THENZ$=CHR$((Z+128)AND255)
60090 IFZL>254THEN60010
60100 IN$=IN$+Z$:PRINTZ$;ZD$;Z$;
60110 IFZ=13ANDZL=1THEN60010
60115 IFZ=13THENIN$=MID$(IN$,2):PRINTR$;:RETURN
60120 IFZ=20ANDZL>1THENIN$=LEFT$(IN$,ZL-1):PRINT"[157]";:GOTO60010
60130 IFZ=141THENZ$=CHR$(-20*(ZL>1)):FORZ=2TOZL:PRINTZ$;:NEXTZ:GOTO60000
60140 GOTO60010
63000 REM
63001 REM MODIFIED 88/01/27 IAN MCINTOSH
63002 REM "" (WHITE) ADDED TO LINE 300
63003 REM "SYS848" REMOVED FROM LINES
63004 REM 440, 490, 510, 520, 550, 580
63005 REM 620, 710, 830, 880, AND 930
63006 REM TO PREVENT CRASH
63007 REM LINE 7000 ADDED
63008 REM LINE 880 ;"[157] " ADDED TWICE
63009 REM LINE 880 " REMOVED
63010 [143] LINES 451, 452 ADDED
63011 LINE 620 " CMDCMDCMD" ADDED
63012 [143] LINE 510 SPACES ADDED
63013 [143] LINE 520 SPLIT INTO 2 PRINTS AND 521 AND SPACES ADDED
63014 [143] LINE 550 SPLIT INTO 2 PRINTS AND 551 AND SPACES ADDED
63015 LINE 340 "GOTO340" NOW "GOTO300"
63999 [128]